package com.wyh.copy;

public class School implements Cloneable{
    Student student;
    String name;

    @Override
    public String toString() {
        return "School{" +
                "student=" + student +
                ", name='" + name + '\'' +
                '}';
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
//        return super.clone();
        School school = (School) super.clone();
        school.student = (Student) this.student.clone();
        return school;
    }
}
